import 'package:flutter/material.dart';

import 'common_page.dart';

//insert multi routes to navigator on navigator initialized via pages
class TabD extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Navigator(
      onPopPage: (route, result) {
        return route.didPop(result);
      },
      onGenerateRoute: onNaviDGenerateRoute,
      pages: [
        MaterialPage(
            name: '/',
            key: ValueKey(1),
            child: CommonPage(settings: RouteSettings(name: 'page1'))),
        MaterialPage(
            name: 'A',
            key: ValueKey(2),
            child: CommonPage(settings: RouteSettings(name: 'page2'))),
        MaterialPage(
            name: 'B',
            key: ValueKey(3),
            child: CommonPage(settings: RouteSettings(name: 'page3'))),
        MaterialPage(
            name: 'C',
            key: ValueKey(4),
            child: CommonPage(settings: RouteSettings(name: 'page4'))),
      ],
    );
  }
}
